<div class="dsn-panel-editor-title">商家设置</div>
<div class="dsn-panel-editor-content">
	<div class="layui-form-item">
		<div class="layui-form-label">与上方距离</div>
		<div class="slider" min="0" max="40" ng-model="Edit.params.margin_y"></div>
		<span class="slider-span"><input ng-model="Edit.params.margin_y"/> px</span>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">背景颜色</div>
		<div class="layui-input-inline">
			<input class="layui-input" value="{{Edit.params.bgcolor}}" ng-model="Edit.params.bgcolor"/>
		</div>
		<span class="colorpicker" ng-model="Edit.params.bgcolor"></span>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">评分</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showpingfen" title="显示" value="1" ng-model="Edit.params.showpingfen" />
			<input class="radio" type="radio" name="{{Edit.id}}_showpingfen" title="不显示" value="0" ng-model="Edit.params.showpingfen"/>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">销量</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showsales" title="显示" value="1" ng-model="Edit.params.showsales" />
			<input class="radio" type="radio" name="{{Edit.id}}_showsales" title="不显示" value="0" ng-model="Edit.params.showsales"/>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">简介</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showjianjie" title="显示" value="1" ng-model="Edit.params.showjianjie" />
			<input class="radio" type="radio" name="{{Edit.id}}_showjianjie" title="不显示" value="0" ng-model="Edit.params.showjianjie"/>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">地址</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showaddress" title="显示" value="1" ng-model="Edit.params.showaddress" />
			<input class="radio" type="radio" name="{{Edit.id}}_showaddress" title="不显示" value="0" ng-model="Edit.params.showaddress"/>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">距离</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showdistance" title="显示" value="1" ng-model="Edit.params.showdistance" />
			<input class="radio" type="radio" name="{{Edit.id}}_showdistance" title="不显示" value="0" ng-model="Edit.params.showdistance"/>
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">商品</div>
		<div class="layui-input-inline">
			<input class="radio" type="radio" name="{{Edit.id}}_showproduct" title="显示" value="1" ng-model="Edit.params.showproduct" />
			<input class="radio" type="radio" name="{{Edit.id}}_showproduct" title="不显示" value="0" ng-model="Edit.params.showproduct"/>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-form-label">进入页面</div>
		<div class="layui-input-inline" style="width: 300px">
			<input class="radio" type="radio" name="{{Edit.id}}_intotype" title="设计首页" value="0" ng-model="Edit.params.intotype"/>

		</div>
		<div class="layui-form-mid layui-word-aux">无设计首页则跳转默认首页</div>
	</div>
	<div style="border: 1px solid #e6e6e6;border-radius: 4px;padding: 5px 10px;">
		{if $auth_data=='all' || in_array('SeckillProduct/*',$auth_data)}
			<div class="layui-form-item">
				<div class="layui-form-label">秒杀商品</div>
				<div class="layui-input-inline">
					<input class="radio" type="radio" name="{{Edit.id}}_showseckill" title="显示" value="1" ng-model="Edit.params.showseckill" />
					<input class="radio" type="radio" name="{{Edit.id}}_showseckill" title="不显示" value="0" ng-model="Edit.params.showseckill"/>
				</div>
			</div>
		{/if}
		{if $auth_data=='all' || in_array('TuangouProduct/*',$auth_data)}
			<div class="layui-form-item">
				<div class="layui-form-label">团购商品</div>
				<div class="layui-input-inline">
					<input class="radio" type="radio" name="{{Edit.id}}_showtuangou" title="显示" value="1" ng-model="Edit.params.showtuangou" />
					<input class="radio" type="radio" name="{{Edit.id}}_showtuangou" title="不显示" value="0" ng-model="Edit.params.showtuangou"/>
				</div>
			</div>
		{/if}
		{if $auth_data=='all' || in_array('KanjiaProduct/*',$auth_data)}
		<div class="layui-form-item">
			<div class="layui-form-label">砍价商品</div>
			<div class="layui-input-inline">
				<input class="radio" type="radio" name="{{Edit.id}}_showkanjia" title="显示" value="1" ng-model="Edit.params.showkanjia" />
				<input class="radio" type="radio" name="{{Edit.id}}_showkanjia" title="不显示" value="0" ng-model="Edit.params.showkanjia"/>
			</div>
		</div>
		{/if}
		{if $auth_data=='all' || in_array('CollageProduct/*',$auth_data)}
		<div class="layui-form-item">
			<div class="layui-form-label">拼团商品</div>
			<div class="layui-input-inline">
				<input class="radio" type="radio" name="{{Edit.id}}_showcollage" title="显示" value="1" ng-model="Edit.params.showcollage" />
				<input class="radio" type="radio" name="{{Edit.id}}_showcollage" title="不显示" value="0" ng-model="Edit.params.showcollage"/>
			</div>
		</div>
		{/if}
		{if $auth_data=='all' || in_array('LuckyCollageProduct/*',$auth_data)}
		<div class="layui-form-item">
			<div class="layui-form-label">幸运拼团</div>
			<div class="layui-input-inline">
				<input class="radio" type="radio" name="{{Edit.id}}_showluckycollage" title="显示" value="1" ng-model="Edit.params.showluckycollage" />
				<input class="radio" type="radio" name="{{Edit.id}}_showluckycollage" title="不显示" value="0" ng-model="Edit.params.showluckycollage"/>
			</div>
		</div>
		{/if}

		<div class="layui-form-item">
			<div class="layui-form-label">显示数量</div>
			<div class="layui-input-inline">
				<input class="layui-input" ng-model="Edit.params.showcuxiaonum" />
			</div>
		</div>
	</div>


	<div class="layui-form-item">
		<div class="layui-form-label">商家来源</div>
		<div class="layui-input-inline" style="width:500px">
			{if !$type}
			<input class="radio" type="radio" name="{{Edit.id}}_businessfrom" value="0" ng-model="Edit.params.businessfrom" title="手动选择"/>
			{/if}
			<input class="radio" type="radio" name="{{Edit.id}}_businessfrom" value="1" ng-model="Edit.params.businessfrom" title="商家分类" ng-change="getbusiness(Edit.id)"/>
		</div>
	</div>
	<div ng-show="Edit.params.businessfrom == '0'">
		<div ng-repeat="good in Edit.data" class="dsn-panel-editor-relative">
			<div class="dsn-panel-editor-del" style="right:30px;font-size:12px" title="上移" ng-click="upItemChild(Edit.id,good.id)"><i class="fa fa-arrow-up"></i></div>
			<div class="dsn-panel-editor-del" title="移除" ng-click="delbusiness(Edit.id,good.id)">×</div>
			<div class="dsn-panel-editor-line flex">
				<div class="dsn-panel-editor-goodimg flex0" ng-click="addbusiness('replace',Edit.id, good.id)">
					<img ng-src="{{good.logo}}" width="100%"/>
					<div class="dsn-panel-editor-goodimg-t2">重新选择商家</div>
				</div>
				<div class="dsn-panel-editor-line-right">
					<div class="layui-form-item">
						<div class="layui-form-label">商家名称</div>
						<div class="layui-form-mid">{{good.name}}</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-form-label">商家地址</div>
						<div class="layui-form-mid">{{good.address}}</div>
					</div>
				</div>
			</div>
		</div>
		<div class="layui-btn layui-btn-primary" style="width:500px;margin-top:10px" ng-click="addbusiness('',Edit.id,'')"><i class="fa fa-plus-circle"></i> 添加一个商家</div>
	</div>
	<div ng-show="Edit.params.businessfrom == '1'">
		<div class="layui-form-item">
			<div class="layui-form-label">商家分类</div>
			<div class="layui-input-inline">
				<select class="layui-input" style="width:200px;-webkit-appearance:menulist" lay-ignore ng-model="Edit.params.category" ng-change="getbusiness(Edit.id)">
					<option value="">全部分类</option>
					{if !$type}
						{foreach $blist as $cv}
							<option value="{$cv['id']}">{$cv['name']}</option>
							{foreach $cv['child'] as $v}
							<option value="{$v['id']}">&nbsp;&nbsp;&nbsp;{$v['name']}</option>
							{/foreach}
						{/foreach}
					{/if}
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-form-label">排序方式</div>
			<div class="layui-input-inline" style="width:500px">
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="sort" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="默认"/>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="createtimedesc" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="创建时间↓"/></i>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="createtime" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="创建时间↑"/></i>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="scoredesc" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="评分"/>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="sales" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="销量"/>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="juli" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="距离"/>
				<input class="radio" type="radio" name="{{Edit.id}}_sortby" value="rand" ng-model="Edit.params.sortby" ng-change="getbusiness(Edit.id)" title="随机"/>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-form-label">显示数量</div>
			<div class="layui-input-inline">
				<input class="layui-input" ng-model="Edit.params.shownum" ng-blur="getbusiness(Edit.id)"/>
			</div>
		</div>
		<div class="layui-form-item" ng-show="Edit.params.sortby == 'juli'">
			<div class="layui-form-label">显示范围</div>
			<div class="slider" min="1" max="100" ng-model="Edit.params.distance"></div>
			<span class="slider-span"><input ng-model="Edit.params.distance"/> km</span>
		</div>
	</div>

	<hr>
	<div class="layui-form-item">
		<div class="layui-form-label">左右边距</div>
		<div class="slider" min="0" max="40" ng-model="Edit.params.margin_x"></div>
		<span class="slider-span"><input ng-model="Edit.params.margin_x"/> px</span>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">左右内边距</div>
		<div class="slider" min="0" max="40" ng-model="Edit.params.padding_x"></div>
		<span class="slider-span"><input ng-model="Edit.params.padding_x"/> px</span>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">上下内边距</div>
		<div class="slider" min="0" max="40" ng-model="Edit.params.padding_y"></div>
		<span class="slider-span"><input ng-model="Edit.params.padding_y"/> px</span>
	</div>
	{if !$type}
	<div class="layui-form-item">
		<div class="layui-form-label">显示平台</div>
		<div class="layui-input-inline" style="width:500px">
			<input class="checkbox" type="checkbox" lay-skin="primary" title="所有平台" name="{{Edit.id}}_platform['all']" ng-model="Edit.params.platform['all']"/>
			{foreach $platform as $pl=>$pl_name}
			<input class="checkbox" type="checkbox" lay-skin="primary" title="$pl_name" name="{{Edit.id}}_platform['{$pl}']" ng-model="Edit.params.platform['{$pl}']"/>
			{/foreach}
		</div>
	</div>
	<div class="layui-form-item">
		<div class="layui-form-label">显示范围</div>
		<div class="layui-input-inline" style="width:500px">
			<input class="checkbox" type="checkbox" lay-skin="primary" title="所有人" name="{{Edit.id}}_quanxian['all']" ng-model="Edit.params.quanxian['all']"/>
			{foreach $level_list as $level}
			<input class="checkbox" type="checkbox" lay-skin="primary" title="{$level.level_name}" name="{{Edit.id}}_quanxian[{$level.rank}]" ng-model="Edit.params.quanxian[{$level.rank}]"/>
			{/foreach}
		</div>
	</div>
	<div class="layui-form-item" ng-show="!Edit.params.quanxian['all']">
    <div class="layui-form-label">显示用户</div>
    <div class="layui-input-inline">
			<input class="layui-input" ng-model="Edit.params.showmids"/>
    </div>
		<div class="layui-form-mid layui-word-aux">填写用户ID，多个用英文标点逗号(,)分割
	</div>
	{else}
		<input class="checkbox" type="hidden" checked='true' lay-skin="primary" title="所有平台" name="{{Edit.id}}_platform['all']" ng-model="Edit.params.platform['all']"/>
		<input class="checkbox" type="hidden" checked='true' lay-skin="primary" title="所有人" name="{{Edit.id}}_quanxian['all']" ng-model="Edit.params.quanxian['all']"/>
		<input class="checkbox" type="hidden" checked='true' lay-skin="primary" title="所有门店" name="{{Edit.id}}_mendian['all']" ng-model="Edit.params.mendian['all']"/>
	{/if}
</div>